bitkeeper revision 1.759 (40431ad2YWsArtM623Q4wpLgPvrt5A)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 1 Mar 2004 11:13:22 +0000 (11:13 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 1 Mar 2004 11:13:22 +0000 (11:13 +0000)
xend.c, Makefile:
  new file
Many files:
  Rename /proc/xeno and /dev/xeno to /proc/xen and /dev/xen. Created a skeleton xend.

.rootkeys
tools/Makefile
tools/balloon/balloon.c
tools/misc/xen_cpuperf.c
tools/misc/xen_log.c
tools/xc/lib/xc_misc.c
tools/xc/py/XenoUtil.py
tools/xend/Makefile [new file with mode: 0644]
tools/xend/xend.c [new file with mode: 0644]
xenolinux-2.4.25-sparse/arch/xeno/drivers/evtchn/xl_evtchn.c
xenolinux-2.4.25-sparse/arch/xeno/lib/xeno_proc.c

index 77e48556d51e09af7ece816a733da8eb6f74c72a..05892b9aa9e770f23d0d3b50cb7fe878b840cdd6 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
@@ -88,6 +88,8 @@
 3fbd0a42l40lM0IICw2jXbQBVZSdZg tools/xc/py/Xc.c
 3fbd4bd6GtGwZGxYUJPOheYIR7bPaA tools/xc/py/XenoUtil.py
 3fbd0a40yT6G3M9hMpaz5xTUdl0E4g tools/xc/py/setup.py
+40431ac64Hj4ixUnKmlugZKhXPFE_Q tools/xend/Makefile
+40431ac8wrUEj-XM7B8smFtx_HA7lQ tools/xend/xend.c
 403a3edbrr8RE34gkbR40zep98SXbg tools/xentrace/Makefile
 403a3edbVpV2E_wq1zeEkJ_n4Uu2eg tools/xentrace/xentrace.c
 403a3edb0lzD0Fojc-NYNoXr3SYrnA tools/xentrace/xentrace_cpusplit.py
index 4717987d6cd8ee99431d424b94f6ee91c0de18ad..17d7c74ca8b474efcb3b7bb965dca034b1a924e8 100644 (file)
@@ -23,6 +23,7 @@ all:
        $(MAKE) -C misc
        $(MAKE) -C examples
        $(MAKE) -C xentrace
+       $(MAKE) -C xend
 
 install: all
        $(MAKE) -C balloon install
@@ -30,6 +31,7 @@ install: all
        $(MAKE) -C misc install
        $(MAKE) -C examples install
        $(MAKE) -C xentrace install
+       $(MAKE) -C xend install
 
 dist: all
        $(MAKE) -C balloon dist
@@ -37,6 +39,7 @@ dist: all
        $(MAKE) -C misc dist
        $(MAKE) -C examples dist
        $(MAKE) -C xentrace dist
+       $(MAKE) -C xend dist
 
 clean:
        $(MAKE) -C balloon clean
@@ -45,4 +48,5 @@ clean:
        $(MAKE) -C examples clean
        $(MAKE) -C nsplitd clean
        $(MAKE) -C xentrace clean
+       $(MAKE) -C xend clean
 
index 9c90a7ab6294a05ed9a0df27d5b66508e9859a69..a8b6c406df3f5ba30ea20abd55e3b059f03736de 100644 (file)
@@ -1,7 +1,7 @@
 /******************************************************************************
  * balloon.c
  *
- * Xeno balloon driver userspace control tool. Used to shrink/grow domain's 
+ * Xen balloon driver userspace control tool. Used to shrink/grow domain's 
  * memory.
  *
  * Copyright (c) 2003, B Dragovic
@@ -31,7 +31,7 @@ typedef struct user_balloon_op {
 
 static int open_balloon_proc()
 {
-    return open("/proc/xeno/balloon", O_RDWR);
+    return open("/proc/xen/balloon", O_RDWR);
 }
 
 /* inflate balloon function signals to kernel it should relinquish memory */
index 8b67f27c852346b2ba9a07b19c16357e252bb053..235ca58a392b9d8492d84d5bab332445a2ff7bca 100644 (file)
@@ -1,10 +1,5 @@
 /*
  * User mode program to prod MSR values through /proc/perfcntr
- *
- *
- * $Id$
- *
- * $Log$
  */
 
 #include <sys/types.h>
@@ -217,7 +212,7 @@ int main(int argc, char **argv)
         }
     }
 
-    if ( (privfd = open("/proc/xeno/privcmd", O_RDWR)) == -1 )
+    if ( (privfd = open("/proc/xen/privcmd", O_RDWR)) == -1 )
     {
         fprintf(stderr, "Could not open privileged Xen control interface.\n");
         exit(1);
index 63bb5afa433edc1d0000781e99bda1459da29052..29f7d4c050076530ad3fe895eb9bd17de7684bcb 100644 (file)
@@ -155,11 +155,11 @@ int main(int argc, char **argv)
                 errno = 2;
                 errexit("daemon");
             } else {
-                openlog("xenolog", LOG_PID, SYSLOGTO);
+                openlog("xen_log", LOG_PID, SYSLOGTO);
             }
             break;
         case 'h':
-            printf("Usage: xenolog [options]\n");
+            printf("Usage: xen_log [options]\n");
             printf("Capture and display output of xen domains.\n\n");
             printf("  -d       Daemonize and send output to syslog.\n");
             exit(0);
index 63c53146b7f49c91084d433b0fa8af6ff9004c9b..15fcead97c6d924c1b7249585a108c7304c43ef4 100644 (file)
@@ -8,7 +8,7 @@
 
 int xc_interface_open(void)
 {
-    int fd = open("/proc/xeno/privcmd", O_RDWR);
+    int fd = open("/proc/xen/privcmd", O_RDWR);
     if ( fd == -1 )
         PERROR("Could not obtain handle on privileged command interface");
     return fd;
index 06a623e9bb30d2f77b7773a8fec2407e8b8fe053..27b6fbb3904e94b8b0d5c2abdc9928c95d8915d0 100644 (file)
@@ -72,7 +72,7 @@ def setup_vfr_rules_for_vif(dom,vif,addr):
     is expressed as a textual dotted quad, and set up appropriate routing
     rules in Xen. No return value.
     """
-    fd = os.open( '/proc/xeno/vfr', os.O_WRONLY )
+    fd = os.open( '/proc/xen/vfr', os.O_WRONLY )
     if ( re.search( '169\.254', addr) ):
         os.write( fd, 'ADD ACCEPT srcaddr=' + addr +
                   ' srcaddrmask=255.255.255.255' +
diff --git a/tools/xend/Makefile b/tools/xend/Makefile
new file mode 100644 (file)
index 0000000..1fb84e0
--- /dev/null
@@ -0,0 +1,30 @@
+
+CC       = gcc
+CFLAGS   = -Wall -O3 
+CFLAGS  += -I../../xen/include -I../../xenolinux-sparse/include
+
+HDRS     = $(wildcard *.h)
+OBJS     = $(patsubst %.c,%.o,$(wildcard *.c))
+
+BIN      = xend
+
+all: $(BIN)
+
+install: all
+       mkdir -p /usr/sbin
+       cp $(BIN) /usr/sbin
+       chmod 755 /usr/sbin/$(BIN)
+
+dist: all
+       mkdir -p ../../../install/sbin
+       cp $(BIN) ../../../install/sbin
+       chmod 755 ../../../install/sbin/$(BIN)
+
+clean:
+       $(RM) *.a *.so *.o *.rpm $(BIN)
+
+$(BIN): $(OBJS)
+       $(CC) $(CFLAGS) -o $@ $^ -L../xc/lib -lxc
+
+%.o: %.c $(HDRS) Makefile
+       $(CC) $(CFLAGS) -c -o $@ $<
diff --git a/tools/xend/xend.c b/tools/xend/xend.c
new file mode 100644 (file)
index 0000000..9da656e
--- /dev/null
@@ -0,0 +1,12 @@
+/******************************************************************************
+ * xend.c
+ * 
+ * The grand Xen daemon. For now it's just a console concentrator.
+ * 
+ * Copyright (c) 2004, K A Fraser
+ */
+
+int main(int argc, char **argv)
+{
+    return 0;
+}
index 1bfd377f9a34720f273271971851d41a3b99e247..cac02015582bffdb4c1fbab21b778e5dd9f60150 100644 (file)
@@ -27,26 +27,26 @@ typedef void (*evtchn_receiver_t)(unsigned int);
 #define PORT_DISCONNECT 0x8000
 #define PORTIDX_MASK    0x7fff
 
-/* /dev/xeno/evtchn resides at device number major=10, minor=200 */
+/* /dev/xen/evtchn resides at device number major=10, minor=200 */
 #define EVTCHN_MINOR 200
 
-/* /dev/xeno/evtchn ioctls: */
+/* /dev/xen/evtchn ioctls: */
 /* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */
 #define EVTCHN_RESET _IO('E', 1)
 
-/* NB. This must be shared amongst drivers if more things go in /dev/xeno */
-static devfs_handle_t xeno_dev_dir;
+/* NB. This must be shared amongst drivers if more things go in /dev/xen */
+static devfs_handle_t xen_dev_dir;
 
-/* Only one process may open /dev/xeno/evtchn at any time. */
+/* Only one process may open /dev/xen/evtchn at any time. */
 static unsigned long evtchn_dev_inuse;
 
-/* Notification ring, accessed via /dev/xeno/evtchn. */
+/* Notification ring, accessed via /dev/xen/evtchn. */
 #define RING_SIZE     2048  /* 2048 16-bit entries */
 #define RING_MASK(_i) ((_i)&(RING_SIZE-1))
 static u16 *ring;
 static unsigned int ring_cons, ring_prod, ring_overflow;
 
-/* Processes wait on this queue via /dev/xeno/evtchn when ring is empty. */
+/* Processes wait on this queue via /dev/xen/evtchn when ring is empty. */
 static DECLARE_WAIT_QUEUE_HEAD(evtchn_wait);
 static struct fasync_struct *evtchn_async_queue;
 
@@ -228,12 +228,17 @@ static ssize_t evtchn_read(struct file *file, char *buf,
 
     add_wait_queue(&evtchn_wait, &wait);
 
-    if ( (count <= 0) || (count > PAGE_SIZE) || ((count&1) != 0) )
+    count &= ~1; /* even number of bytes */
+
+    if ( count == 0 )
     {
-        rc = -EINVAL;
+        rc = 0;
         goto out;
     }
 
+    if ( count > PAGE_SIZE )
+        count = PAGE_SIZE;
+
     for ( ; ; )
     {
         set_current_state(TASK_INTERRUPTIBLE);
@@ -307,12 +312,17 @@ static ssize_t evtchn_write(struct file *file, const char *buf,
     if ( kbuf == NULL )
         return -ENOMEM;
 
-    if ( (count <= 0) || (count > PAGE_SIZE) || ((count&1) != 0) )
+    count &= ~1; /* even number of bytes */
+
+    if ( count == 0 )
     {
-        rc = -EINVAL;
+        rc = 0;
         goto out;
     }
 
+    if ( count > PAGE_SIZE )
+        count = PAGE_SIZE;
+
     if ( copy_from_user(kbuf, buf, count) != 0 )
     {
         rc = -EFAULT;
@@ -427,8 +437,8 @@ static int __init init_module(void)
         return err;
     }
 
-    /* (DEVFS) create directory '/dev/xeno'. */
-    xeno_dev_dir = devfs_mk_dir(NULL, "xeno", NULL);
+    /* (DEVFS) create directory '/dev/xen'. */
+    xen_dev_dir = devfs_mk_dir(NULL, "xen", NULL);
 
     /* (DEVFS) &link_dest[pos] == '../misc/evtchn'. */
     pos = devfs_generate_path(evtchn_miscdev.devfs_handle, 
@@ -437,8 +447,8 @@ static int __init init_module(void)
     if ( pos >= 0 )
         strncpy(&link_dest[pos], "../", 3);
 
-    /* (DEVFS) symlink '/dev/xeno/evtchn' -> '../misc/evtchn'. */
-    (void)devfs_mk_symlink(xeno_dev_dir, 
+    /* (DEVFS) symlink '/dev/xen/evtchn' -> '../misc/evtchn'. */
+    (void)devfs_mk_symlink(xen_dev_dir, 
                            "evtchn", 
                            DEVFS_FL_DEFAULT, 
                            &link_dest[pos],
index 40b0d6086f874a7ba841a4a690dae5ced42730c5..2eca39d6aaae1bdff1e0aa550ea46c383bb0d68c 100644 (file)
@@ -7,8 +7,8 @@ static struct proc_dir_entry *xeno_base;
 struct proc_dir_entry *create_xeno_proc_entry(const char *name, mode_t mode)
 {
     if ( xeno_base == NULL )
-        if ( (xeno_base = proc_mkdir("xeno", &proc_root)) == NULL )
-            panic("Couldn't create /proc/xeno");
+        if ( (xeno_base = proc_mkdir("xen", &proc_root)) == NULL )
+            panic("Couldn't create /proc/xen");
     return create_proc_entry(name, mode, xeno_base);
 }